<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业5</title>
</head>
<body>
<script>
    const arr = new Array(6);

    function getSum(arr) {
        let sum = 0;
        for (let i = 0; i < 6; i++) {
            arr[i] = Math.floor(Math.random() * 100);
        }
        for (let item of arr) {
            console.log(item);
        }
        for (let item of arr) {
            sum = sum + item;
        }
        return sum;
    }

    console.log("sum=" + getSum(arr));
</script>
</body>
</html>